<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%@page import="java.sql.Connection"%>
<%@page import="java.util.List"%>

<%@page import="br.com.bean.EnsinoBean"%>
<%@page import="br.com.bean.TurnoBean"%>
<%@page import="br.com.bean.TurmaBean"%>
<%@page import="br.com.bean.DisciplinaBean"%>
<%@page import="br.com.connection.ConnectionFactory"%>
<%@page import="br.com.controller.EnsinoController"%>
<%@page import="br.com.controller.TurnoController"%>
<%@page import="br.com.controller.DisciplinaController"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Cadastro de Turma</title>
<!-- Css Principal -->
<link rel="stylesheet" type="text/css" href="Css/css.css" />
<link rel="stylesheet" href="Jquery/jquery-ui-1.8.19.custom.css" />

<!-- Endereço da jquery -->
<script src="Jquery/jquery-1.6.2.min.js"></script>
<script src="Jquery/jquery-ui-1.8.16.custom.min.js"></script>
<script type='text/javascript' src='Script/nivelsenha.js'></script>
<script type='text/javascript' src='Script/mascaras.js'></script>
 <script type='text/javascript' src='Script/Cadturma.js'></script>
<script type='text/javascript' src='Script/ajax.js'></script>

</head>
<body>
	<div id="html">
		<form method="post" name="fmr" id="fmr" action="CadTurmaServlet" onsubmit="return validaCadTurma(this);">

<%Connection conn = new ConnectionFactory().getConnection();%>

			<h2>Cadastro de Turma</h2>

			<table>
				<tr>
					<th>Turno:</th>
					<td><select name="turno" id="turno" onchange="MandaID(this.value, 'ensino.jsp', 'ensino');">
							<option value="0">Selecione</option>
							<%List<TurnoBean> turno = TurnoController.ListTurno(conn);
							for(TurnoBean t : turno){
							%>
							<option value="<%=t.getId()%>"><%=t.getDescricao()%></option>
							<%
								}
							%>
					</select>
					</td>
				</tr>
				<tr>
					<th>Ensino:</th>
					<td><select name="ensino" id="ensino" onchange="MandaID(this.value, 'serie.jsp', 'serie');">
					<option value="0">Selecione</option>		
					</select></td>
				</tr>
				<tr>
					<th>Série:</th>
					<td><select name="serie" id="serie" >
							<option value="0">Selecione</option>
					</select>
					</td>
				</tr>
				<tr>
					<th>Nome da Turma:</th>
					<td><input type="text" name="nometurma" id="nometurma"
						 maxlength="10" />
					</td>
				</tr>
				<tr>
					<th>Dias letivos:</th>
					<td><input type="text" name="diasletivos" id="diasletivos"
						maxlength="3" />
					</td>
				</tr>
				<tr>
					<th>Ano letivo:</th>
					<td><input type="text" name="ano" id="ano" maxlength="4" />
					</td>
				</tr>
			</table>
			<div id="mensagem"></div> 
			<input type="submit" name="finalizar" id="finalizar" value="Finalizar" />
			<input type="reset" name="cancelar" id="cancelar" value="Cancelar" />
		</form>
	</div>
</body>
</html>